﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Sbook
{
    public partial class DemoShop : System.Web.UI.Page
    {
        protected static string DeId = "";
        protected static string DId = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DId = Request.QueryString["DId"];
                BindData(DId);
            }
        }
        private void BindData(string DId)
        {
            grdShop.DataSource = Business.DeliveryDetailService.DeliveryDetail_GetByAll().FindAll(de => de.DeliveryId == DId);
            grdShop.DataBind();
            for (int i = 0; i < grdShop.Items.Count; i++)
            {
                grdShop.Items[i].Cells[1].Text = Business.ProductsService.Products_GetById(grdShop.Items[i].Cells[1].Text)[0].PName;
            }
        }

        protected void lbtEdit_Click(object sender, EventArgs e)
        {
            LinkButton link = sender as LinkButton;
            string PId = link.CommandArgument.ToString();
            Response.Write("<script>alert('" + PId + "');</script>");
        }
    }
}